package test.format_test;

import java.util.ArrayList;
import java.util.List;

public class ForGenneric<e> {
    e a;
    void de(e e){
        this.a = e;
    }
}

class gen<t> extends ForGenneric{   //在继承泛型类的同时就已经指定好了泛型 此时object
    t a;
}

class gmain{
    public static void main(String[] args) {
        ForGenneric<Object> a= new gen<Integer>();
        ForGenneric<Object> a1= new ForGenneric<>();    //编译器会对这种情况进行判断，自动补全
        //ForGenneric<Object> a1= new ForGenneric<Integer>();    泛型不具备继承性
        //List<Object> a1 = new ArrayList<Integer>();
        //ArrayList<Object> a1 = new ArrayList<Integer>();
        new gmain().getG("haha",123);
        List<? extends ForGenneric> a2 = new ArrayList<>();
        List<Integer> la =new ArrayList<>();
    }
    void getList(List<? extends ForGenneric> a){
        for(ForGenneric b:a){
        }

    }
    <G,T> void getG(G g,T t){
        System.out.println(g.getClass());
        System.out.println(t.getClass());
    }

}